using Loxodon.Framework.ViewModels;

namespace Master.Example.LoxodonFramework
{
    public class ViewModel : ViewModelBase
    {
        public Model Model { get; set; }

        public ViewModel()
        {
            // 注入 Model 对象
            Model = App.Container.Resolve<Model>();
        }

        public int Count
        {
            get { return Model.Count; }
            set
            {
                // 用来通知数据更新
                this.Set<int>(ref Model.Count, value, "Count");
            }
        }

        public void IncreaseCount()
        {
            Count++;
        }

        public void DecreaseCount()
        {
            Count--;
        }
    }
}